home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 30
/
Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso
/
Aminet
/
util
/
wb
/
DockNet20_src.lha
/
DockNet.e
< prev
next >
Wrap
Text File
|
1998-10-15
|
6KB
|
185 lines
/* Start of DockNet */
OPT PREPROCESS
#define STR [256]:STRING
MODULE 'utility/tagitem','dos/dos'
MODULE 'libraries/gadtools'
MODULE'muimaster','libraries/mui','libraries/muip','mui/muicustomclass','amigalib/boopsi','intuition/classes','intuition/classusr','intuition/screens','intuition/intuition'
MODULE'tools/boopsi'
MODULE'utility/hooks'
ENUM NULL,ID_EPROGA, ID_EPROGB, ID_EPROGC, ID_EPROGD, ID_EPROGE, ID_EPROGF, ID_EPROGG, ID_EPROGH, ID_EPROGI
PROC main() HANDLE
/*
DEFINIR VARs DA GUI COM DEF ... E TB OUTRAS VARs
*/
DEF app,sigs,wi_label_0,running,result,file,btp1,btp2,btp3,btp4,btp5,btp6,btp7,btp8,btp9,pg1 STR,pg1p STR,pg2 STR,pg2p STR,pg3 STR,pg3p STR,pg4 STR,pg4p STR,pg5 STR,pg5p STR,pg6 STR,pg6p STR,pg7 STR,pg7p STR,pg8 STR,pg8p STR,pg9 STR,pg9p STR
file := Open('ENV:DockNet/DockNet.prefs', OLDFILE)
ReadStr(file,pg1)
ReadStr(file,pg1p)
ReadStr(file,pg2)
ReadStr(file,pg2p)
ReadStr(file,pg3)
ReadStr(file,pg3p)
ReadStr(file,pg4)
ReadStr(file,pg4p)
ReadStr(file,pg5)
ReadStr(file,pg5p)
ReadStr(file,pg6)
ReadStr(file,pg6p)
ReadStr(file,pg7)
ReadStr(file,pg7p)
ReadStr(file,pg8)
ReadStr(file,pg8p)
ReadStr(file,pg9)
ReadStr(file,pg9p)
Close(file)
IF (muimasterbase:=OpenLibrary(MUIMASTER_NAME,MUIMASTER_VMIN))=NIL THEN
Raise('Failed to open muimaster.library')
app := ApplicationObject,
MUIA_Application_Author, 'Luis Domingos',
MUIA_Application_Base, 'NetDock',
MUIA_Application_Version, '$VER: Luis 02.00 (14.10.98)',
MUIA_Application_Copyright, 'c1997 Luis',
MUIA_Application_Description, 'Launch Net Apps',
SubWindow, wi_label_0:=WindowObject,
MUIA_Window_Title, 'DockNet',
MUIA_Window_ID, "0WIN",
MUIA_Window_SizeGadget, 1,
WindowContents, HGroup,
Child, btp1 := SimpleButton(pg1),
Child, btp2 := SimpleButton(pg2),
Child, btp3 := SimpleButton(pg3),
Child, btp4 := SimpleButton(pg4),
Child, btp5 := SimpleButton(pg5),
Child, btp6 := SimpleButton(pg6),
Child, btp7 := SimpleButton(pg7),
Child, btp8 := SimpleButton(pg8),
Child, btp9 := SimpleButton(pg9),
End,
End,
End
IF (app=NIL) THEN
Raise('Failed to create Application.')
/*
** Install notification events...
*/
doMethod(btp1, [MUIM_Notify, MUIA_Pressed, MUI_TRUE,app, 2,MUIM_Application_ReturnID,ID_EPROGA,MUI_TRUE])
doMethod(btp2, [MUIM_Notify, MUIA_Pressed, MUI_TRUE,app, 2,MUIM_Application_ReturnID,ID_EPROGB,MUI_TRUE])
doMethod(btp3, [MUIM_Notify, MUIA_Pressed, MUI_TRUE,app, 2,MUIM_Application_ReturnID,ID_EPROGC,MUI_TRUE])
doMethod(btp4, [MUIM_Notify, MUIA_Pressed, MUI_TRUE,app, 2,MUIM_Application_ReturnID,ID_EPROGD,MUI_TRUE])
doMethod(btp5, [MUIM_Notify, MUIA_Pressed, MUI_TRUE,app, 2,MUIM_Application_ReturnID,ID_EPROGE,MUI_TRUE])
doMethod(btp6, [MUIM_Notify, MUIA_Pressed, MUI_TRUE,app, 2,MUIM_Application_ReturnID,ID_EPROGF,MUI_TRUE])
doMethod(btp7, [MUIM_Notify, MUIA_Pressed, MUI_TRUE,app, 2,MUIM_Application_ReturnID,ID_EPROGG,MUI_TRUE])
doMethod(btp8, [MUIM_Notify, MUIA_Pressed, MUI_TRUE,app, 2,MUIM_Application_ReturnID,ID_EPROGH,MUI_TRUE])
doMethod(btp9, [MUIM_Notify, MUIA_Pressed, MUI_TRUE,app, 2,MUIM_Application_ReturnID,ID_EPROGI,MUI_TRUE])
doMethod(wi_label_0, [MUIM_Notify, MUIA_Window_CloseRequest, MUI_TRUE, app,2,MUIM_Application_ReturnID,MUIV_Application_ReturnID_Quit,MUI_TRUE])
/*
** This is the ideal input loop for an object oriented MUI application.
** Everything is encapsulated in classes, no return ids need to be used,
** we just check if the program shall terminate.
** Note that MUIM_Application_NewInput expects sigs to contain the result
** from Wait() (or 0). This makes the input loop significantly faster.
*/
set(wi_label_0,MUIA_Window_Open,MUI_TRUE)
running := TRUE /* Not for MUI -> no need to use MUI_TRUE */
WHILE running
result := doMethod(app, [MUIM_Application_Input, {sigs} ])
SELECT result
CASE MUIV_Application_ReturnID_Quit
running := FALSE
CASE ID_EPROGA
Execute(pg1p, NIL, NIL)
CASE ID_EPROGB
Execute(pg2p, NIL, NIL)
CASE ID_EPROGC
Execute(pg3p, NIL, NIL)
CASE ID_EPROGD
Execute(pg4p, NIL, NIL)
CASE ID_EPROGE
Execute(pg5p, NIL, NIL)
CASE ID_EPROGF
Execute(pg6p, NIL, NIL)
CASE ID_EPROGG
Execute(pg7p, NIL, NIL)
CASE ID_EPROGH
Execute(pg8p, NIL, NIL)
CASE ID_EPROGI
Execute(pg9p, NIL, NIL)
ENDSELECT
IF sigs THEN Wait(sigs)
ENDWHILE
set(wi_label_0,MUIA_Window_Open,FALSE)
/*
** Shut down...
*/
EXCEPT DO
IF app THEN Mui_DisposeObject(app)
IF muimasterbase THEN CloseLibrary(muimasterbase)
IF exception THEN WriteF('\s\n',exception)
ENDPROC
PROC doMethod( obj:PTR TO object, msg:PTR TO msg )
DEF h:PTR TO hook, o:PTR TO object, dispatcher
IF obj
o := obj-SIZEOF object /* instance data is to negative offset */
h := o.class
dispatcher := h.entry /* get dispatcher from hook in iclass */
MOVEA.L h,A0
MOVEA.L msg,A1
MOVEA.L obj,A2 /* probably should use CallHookPkt, but the */
MOVEA.L dispatcher,A3 /* original code (doMethod()) doesn't. */
JSR (A3) /* call classDispatcher() */
MOVE.L D0,o
RETURN o
ENDIF
ENDPROC NIL
/* End of DockNet */